package br.com.siscov.control.form;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import br.com.siscov.model.vo.LoginVo;

public class LogarUsuarioForm extends BaseForm{

		private static final long serialVersionUID = 1L;
		private String login;
		private String senha;

		public String getLogin() {
			return login;
		}

		public void setLogin(String login) {
			this.login = login;
		}

		public String getSenha() {
			return senha;
		}

		public void setSenha(String senha) {
			this.senha = senha;
		}

		public LoginVo populaVO() { 
			LoginVo log = new LoginVo();
			log.setLogin(this.login);
			log.setSenha(this.senha);

			return log;
		}

		public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
			ActionErrors errors = new ActionErrors();
			List<String> valores = new ArrayList<String>();
			
			valores.add(login);
			valores.add(senha);
			validarObrigatorio(errors, valores);		

			return errors;
		}
	}

	

